/*
 *  初始化轮廓(size)
 */
import { useState, useEffect } from 'react';
import { Layout } from '../DesignerModels';

export const useInitSize = (id: string) => {
  const [initSize, setInitSize] = useState<any>();

  useEffect(() => {
    let layout = new Layout({ id });

    if (layout?.size.width > 0 && layout?.size.height > 0) {
      setInitSize(layout?.size);
    }
  }, [id]);

  return {
    initSize,
  };
};
